﻿package net.area80.object
{
	import flash.utils.describeType;
	/**
	* DatatypeObject
	* @author Wissarut Pimanmassuriya
	*/
	public class DataTypeObject 
	{
		public function toString ():String {
			var typeXML:XML = describeType(this);
			var s:String = "[Object "+String(typeXML.@name).split("::")[1]+" {";
			var isFirst:Boolean = true;
			for each (var node:XML in typeXML.variable) {
				s +=  ((!isFirst)?", " : "") + [node.@name] + ":" + this[node.@name];
				if (isFirst) isFirst = false;
			}
			s += "}];"
			return s;
		}
	}
	
}